//
//  GradientDemo.swift
//  firstFontAttrDemo
//
//  Created by liy on 2025/1/20.
//

import SwiftUI

struct GradientDemo: View {
    var body: some View {
			VStack {
				//线性，辐射，椭圆，角度渐变
//				LinearGradient(colors: [.red,.blue], startPoint: UnitPoint(x: 0, y: 0), endPoint: UnitPoint(x: 1, y: 1))
//				RadialGradient(colors: [.red,.blue], center: UnitPoint(x: 0.5, y: 0.5), startRadius: 0, endRadius: 200)
//				EllipticalGradient(colors: [.orange,.blue])
//				AngularGradient(colors: [.red,.blue], center: UnitPoint(x: 0.5, y: 0.5),angle: Angle(degrees: 180))

//				可以配合形状
				Rectangle()
					.fill(LinearGradient(colors: [.red,.blue], startPoint: UnitPoint(x: 0, y: 0), endPoint: UnitPoint(x: 1, y: 1)))
				
			}
    }
}

#Preview {
    GradientDemo()
}
